The present invention relates to data caching, and in particular, to a method and system for managing cache invalidation.
Generally, a computer software application may be executed on a single computer system. However, larger or more complex software applications that may require a large amount of processing may run very slowly on a single computer system, or, even worse, may not be able to run at all on a single computer system. Thus, these types of software applications may run in a clustered environment where multiple computer systems share the process demands of the software application. In a clustered environment, multiple computer systems, referred to as nodes, are commonly linked together via a local area network, and share in the processing demands of the software application.
Caching is a well-known technique for quick access to data. One method of caching data is to replicate the data and store it in another location where it would be quicker to access the data in the other location than it would be to access the data in the original location. One criteria that may be used to determine whether to cache particular data is if the particular data is frequently accessed. An example where data caching may be used is a software application which accesses data stored in a database. Data that is often accessed by the software application may be cached (e.g., locally on the same node in a cluster). In that case, the cached data may be replicated and stored in another location where access to the data would be faster than accessing the data stored in the database (e.g., the local computer system memory). Since cached data is a duplicate of the original data, the cached data must be updated when the original data is modified or deleted in order to maintain data consistency. Following the above example, when the software application modifies or deletes data in the database and such data is also cached (i.e., the data in the cache has been invalidated), the cached data must be changed to reflect the change the software made to the data in the database.
Caching and clustering may both be used in conjunction to allow processor-intensive software applications to operate quickly and efficiently. That is, clustering may provide the processing power needed to run the software application, and caching may allow the software application to quickly retrieve that data that it needs to perform its tasks. An example where caching and clustering may be utilized is a software application that processes a large amount of requests from users (e.g., clients) where the requests require the software application to access data stored in a database. Accordingly, each node in the cluster will have its own copy of cached data. When a user request changes data in the database and such data is also cached (i.e., the data in the cache has been invalidated), the cached data in each node in the cluster must be changed to reflect the change to the data in the database made by the server software application.
Thus, there is a need for improved synchronization of caches in nodes in a clustered environment. The present invention solves these and other problems by providing a method and system for managing cache invalidation in a clustered environment.